<template>
  <div class="page">
    <div class="address-wrapper">
      <div class="address-info">
        <div class="flex-y-center">
          <span class="name">闸阀是否</span>
          <span class="phone">1388888</span>
        </div>
        <div class="address-text">辽宁省沈阳市大东区************</div>
      </div>
    </div>

    <div class="store-info flex-y-center">
      <el-image :src="require('@/assets/img/logo.png')" class="store-avatar"></el-image>
      <div class="right-info">
        <div class="name">沈阳1好仓库</div>
        <div class="info-row">
          <span>联系人：</span>
          <span class="content">王经理</span>
        </div>
        <div class="info-row">
          <span>联系电话：</span>
          <span class="content">13287888</span>
        </div>
      </div>
    </div>

    <div class="product-info flex">
      <div class="product-info-left">
        <div class="top">
          <el-image
            :src="require('@/assets/img/test.png')"
            class="product-avatar"
          ></el-image>
          <div style="width: 40%">
            <div class="product-name">山推矿山利器 全新470挖掘机</div>
            <div class="status-text">待收货</div>
            <div class="flex-x-bet-y-center">
              <div class="price">￥150000</div>
              <div class="count">×1</div>
            </div>
          </div>
        </div>
        <div class="product-info-row">
          <span class="title">交易类型：</span>
          <span class="content">厂家货源</span>
        </div>
        <div class="product-info-row" style="padding: 0">
          <span class="title">订单备注：</span>
          <span class="content">
            <input type="text" class="title" placeholder="选填……" />
          </span>
        </div>
      </div>
    </div>

    <div class="info-area">
      <div class="title">价格明细</div>
      <div class="content-area flex">
        <div class="flex-1">
          <div class="area-row">
            <span class="label">保证金：</span>
            <span class="content">￥150000</span>
          </div>
          <div class="area-row">
            <span class="label">商品价格：</span>
            <span class="content">￥150000</span>
          </div>
          <div class="area-row">
            <span class="label">邮费：</span>
            <span class="content">￥150000</span>
          </div>
          <div class="area-row">
            <span class="label">合计：</span>
            <span class="price">￥150000</span>
          </div>
        </div>

        <div class="flex-1 flex" style="flex-direction:column;justify-content: flex-end">
          <div class="area-row">
            <span class="label">服务费：</span>
            <span class="content">￥150000</span>
          </div>
          <div class="area-row">
            <span class="label">实际收入：</span>
            <span class="price">￥150000</span>
          </div>
        </div>
      </div>
    </div>

    <div class="info-area">
      <div class="title">订单详情</div>
      <div class="content-area">
        <div class="area-row">
          <span class="label">订单编号：</span>
          <span class="content">55552615658641652</span>
        </div>
        <div class="area-row">
          <span class="label">创建时间：</span>
          <span class="content">2024-1-1</span>
        </div>
        <div class="area-row">
          <span class="label">支付方式：</span>
          <span class="content">微信支付</span>
        </div>
        <div class="area-row">
          <span class="label">用户支付保证金时间：</span>
          <span class="content">2024-1-1</span>
        </div>
        <div class="area-row">
          <span class="label">商家确认时间：</span>
          <span class="content">2024-1-1</span>
        </div>
        <div class="area-row">
          <span class="label">支付货款时间：</span>
          <span class="content">2024-1-1</span>
        </div>
        <div class="area-row">
          <span class="label">发货时间：</span>
          <span class="content">2024-1-1</span>
        </div>
        <div class="area-row">
          <span class="label">收货时间：</span>
          <span class="content">2024-1-1</span>
        </div>
      </div>
    </div>

    <div class="info-area">
      <div class="title">发票信息</div>
      <div class="content-area">
        <div class="area-row">
          <span class="label">发票设置：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">发票抬头：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">公司名称：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">公司税号：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">注册地址：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">注册电话：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">开户银行：</span>
          <span class="content">专票</span>
        </div>
        <div class="area-row">
          <span class="label">银行账号：</span>
          <span class="content">专票</span>
        </div>
      </div>
    </div>

    <!-- <div class="invoice-wrapper">
      <div class="invoice-types">
        <el-form label-width="100px">
          <el-form-item label="发票设置：">
            <el-radio
              v-model="radio"
              :label="item.label"
              v-for="item in invoiceTypeArr"
              :key="item.value"
            ></el-radio>
          </el-form-item>
          <el-form-item label="发票抬头：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入发票抬头"
            ></el-input>
          </el-form-item>
          <el-form-item label="公司名称：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入公司名称"
            ></el-input>
          </el-form-item>
          <el-form-item label="公司税号：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入公司税号"
            ></el-input>
          </el-form-item>
          <el-form-item label="注册地址：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入注册地址"
            ></el-input>
          </el-form-item>
          <el-form-item label="注册电话：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入注册电话"
            ></el-input>
          </el-form-item>
          <el-form-item label="开户银行：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入开户银行"
            ></el-input>
          </el-form-item>
          <el-form-item label="银行账号：">
            <el-input
              type="text"
              v-model="registerForm.username"
              placeholder="请输入银行账号"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
    </div> -->

    <div class="pay-type-wrapper">
      <!-- <div class="title">选择支付方式</div>
      <div class="pay-type-list">
        <div
          class="pay-type-item"
          @click="togglePayType(item)"
          :style="{
            backgroundImage:
              registerForm.payType === item.value
                ? `url(${require('@/assets/img/pay-type-bg.png')})`
                : '',
            borderColor: registerForm.payType === item.value ? 'transparent' : '#ccc',
          }"
          v-for="(item, index) in buyPayType"
          :key="item.value"
        >
          <img :src="item.icon" alt="" class="icon-pay" />
          <span>{{ item.label }}</span>
        </div>
      </div> -->
      <div class="total-price">
        <span>总计：</span>
        <span class="price">￥150000</span>
      </div>

      <el-button type="primary" class="submit-btn">去付款</el-button>
    </div>
  </div>
</template>

<script>
import { invoiceType, buyPayType, const2Arr } from "@/consts";
export default {
  name: "ComponentName",

  data() {
    return {
      isAddress: false,
      radio: 1,
      invoiceType,
      buyPayType,
      invoiceTypeArr: const2Arr(invoiceType),
      buyPayType: const2Arr(buyPayType),
      registerForm: {
        payType: buyPayType.ali.value,
      },
    };
  },

  methods: {
    togglePayType(item) {
      this.registerForm.payType = item.value;
    },
    toAddress() {
      this.$router.push("/address-info");
    },
  },
};
</script>

<style lang="scss" scoped>
.page {
  width: 100%;
  margin: auto;
  background: #f7f7f7;
}

.address-wrapper {
  margin: 0 0 25px;
  padding: 30px 50px;
  background: #fff;
  box-sizing: border-box;
  border: 1px solid #ededed;

  .name {
    font-weight: bold;
    font-size: 18px;
    color: #333333;
    margin-right: 100px;
  }

  .phone {
    font-weight: 400;
    font-size: 16px;
    color: #666666;
  }

  .address-text {
    font-size: 16px;
    color: #333333;
    line-height: 40px;
    padding-top: 20px;
  }

  .no-address {
    width: 100%;
    font-size: 20px;
    text-align: center;
    font-size: 18px;
  }

  .add-address {
    color: #fe5a13;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    font-size: 18px;
  }
}

.store-info {
  padding: 30px 50px;
  background: #fff;
  border: 1px solid #ededed;

  .store-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
  }

  .right-info {
    padding-left: 20px;

    .name {
      font-weight: bold;
      font-size: 18px;
      color: #333333;
    }

    .info-row {
      padding-top: 10px;
      font-size: 16px;
      color: #808080;

      .content {
        color: #333333;
      }
    }
  }
}

.product-info {
  position: relative;
  background: #ffffff;
  padding: 20px 50px;
  margin: 25px 0;
  border: 1px solid #ededed;

  .product-info-left {
    flex: 1;

    .top {
      display: flex;
      align-items: center;

      .product-avatar {
        width: 88px;
        height: 88px;
        margin-right: 15px;
        align-self: flex-start;
      }

      .product-name {
        font-weight: bold;
        font-size: 18px;
        color: #333333;
        padding-bottom: 20px;
      }

      .status-text {
        position: absolute;
        right: 40px;
        top: 30px;
        font-weight: bold;
        font-size: 18px;
        color: #fe5a13;
      }

      .price {
        font-weight: 400;
        font-size: 18px;
        color: #f42d1f;
      }

      .count {
        font-weight: 400;
        font-size: 16px;
        color: #767676;
      }
    }
  }

  .product-info-row {
    padding: 20px 0;
    font-weight: 400;
    font-size: 16px;

    .title {
      color: #000000;
    }

    .content {
      color: #808080;
    }

    input {
      font-size: 16px;
      border: 0;
      outline: none;
    }

    .price {
      color: #f42d1f;
    }
  }

  .product-info-right {
    margin-left: 150px;
    flex: 1;
  }
}

.info-area {
  background: #ffffff;
  border-radius: 0px 0px 0px 0px;
  border: 1px solid #ededed;
  margin: 20px 0;

  .title {
    padding: 20px 50px;
    border-bottom: 1px solid #ededed;
    font-weight: normal;
    font-size: 16px;
    color: #000000;
  }

  .content-area {
    padding: 14px 50px;

    .area-row {
      padding: 6px 0;
      font-weight: normal;
      font-size: 14px;
      color: #333333;

      .label {
        color: #767676;
      }

      .price {
        color: #f42d1f;
      }
    }
  }
}

.invoice-wrapper {
  background: #fff;
  margin: 25px 0;
  padding: 40px;

  .radios {
    display: flex;
    align-items: center;
    margin-left: 0 !important;
  }

  ::v-deep .el-form-item__label {
    font-size: 16px;
  }

  ::v-deep .el-radio {
    line-height: 56px;
  }

  ::v-deep .el-radio__label {
    font-size: 16px;
  }

  ::v-deep .el-radio__inner {
    width: 20px;
    height: 20px;
  }

  ::v-deep .el-form-item__label {
    line-height: 56px;
    font-size: 16px;
    width: 120px;
  }

  // 设置文本框长度
  ::v-deep .el-input__inner {
    width: 548px;
    height: 56px;
    font-size: 16px;
  }
}

.pay-type-wrapper {
  background: #fff;
  margin: 25px 0;
  padding-bottom: 100px;

  .title {
    padding: 30px 40px;
    font-weight: 400;
    font-size: 18px;
    color: #000000;
    border-bottom: 1px solid #ededed;
  }

  .pay-type-list {
    display: flex;
    align-items: center;
    padding: 30px 40px;
    border-bottom: 1px solid #ededed;

    .pay-type-item {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 154px;
      height: 46px;
      background-size: 100% 100%;
      font-weight: 400;
      font-size: 16px;
      color: #000000;
      margin-right: 15px;
      cursor: pointer;
      border-width: 1px;
      border-style: solid;

      .icon-pay {
        width: 44px;
        height: 44px;
      }
    }
  }

  .total-price {
    display: flex;
    align-items: center;
    padding: 30px 40px;
    font-weight: 400;
    font-size: 16px;
    color: #333333;

    .price {
      font-weight: 400;
      font-size: 22px;
      color: #f42d1f;
    }
  }
}

.submit-btn {
  display: block;
  width: 250px;
  height: 46px;
  border-radius: 10px;
  margin: 100px auto 0;
  font-size: 18px;
}
</style>
